//
//  FLSocketManager.h
//  
//
//  Created by liuzhu on 2018/9/3.
//  Copyright © 2018年 liuzhu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "FLAsyncSocket.h"
#import "FLSocketConfig.h"

@class FLSocketManager;

@protocol FLSocketManagerDelegate <NSObject>
@required
-(void)socketConnected;
-(void)socketDisconnected;
-(void)socketReceiveData:(NSString*)message andTag:(NSInteger)tag;
-(void)socketFailConnected;
@end

@interface FLSocketManager : NSObject<GCDAsyncSocketDelegate>
@property(nonatomic,weak)id<FLSocketManagerDelegate>delegate;
@property (nonatomic, assign) BOOL isConnetced;
//连接
-(void)connectToDeviceWithIp:(NSString*)ip  port:(NSString*)port timeout:(NSInteger)time reserve:(NSDictionary*)reserve;

//发送数据
-(void)sendDataWith:(NSString *)dataStr  andTag:(NSInteger)tag;

//关闭连接
-(void)closeSocket;


@end
